#include "captchadesc.h"

int CaptchaDesc::lastHash=0;

CaptchaDesc::CaptchaDesc(QString address){
    this->address=address;
    this->hash=lastHash++;
}

QString CaptchaDesc::getAddress(){
    return address;
}
int CaptchaDesc::getHash(){
    return hash;
}
void CaptchaDesc::setChallange(QString a){
    challange=a;
};
QString CaptchaDesc::getChallange(){
    return challange;
};
QString CaptchaDesc::getCaption(){
    return text;
}

void CaptchaDesc::setCaption(QString a){
    text=a;
};


QString CaptchaDesc::getOutFilename(){
    return address.right(address.length()-address.lastIndexOf("/"));
};

QString CaptchaDesc::toString(){
    QString desc;
    desc.append("Hash: "+QString().setNum(hash)+"\n");
    desc.append("Address: "+address+"\n");
    desc.append("Caption: "+text+"\n");
    desc.append("Name: "+name+"\n");
    desc.append("Challange: "+challange+"\n");
    return desc;
};
